#{extends 'ApiDoc/base.html'/}

<script>
    $(function(){
    });
</script>

<link rel="stylesheet" type="text/css"
      href="#{href '/public/apidoc/layout/res_iframe.css'/}"/>

<link rel="stylesheet" href="#{href '/public/apidoc/view.css'/}">

<div class="page_doc">
    <div class="main_hd"><h2 id="title">${clazz.getString('title')}</h2></div>
    <div class="main_bd">
        <div class="article_box">
            <div class="inner">
                <div id="content" class="news_content">

                    <h2>字段说明</h2>

                    <p>
                        ${clazz.getString('note')}
                    </p>
                    <table class="table">
                        <thead>
                        <tr>
                            <th>字段</th>
                            <th>名称</th>
                            <th>类型</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        #{list items: clazz.getJSONArray('fields'), as: 'field'}
                        %{
                        def type = field.getString('type')
                        def isPr = false;
                        if(type == 'Integer'
                                || type == 'Double'
                                || type == 'Float'
                                || type == 'Boolean'
                                || type == 'Long'
                                || type == 'Byte'
                                || type == 'Short'
                                || type == 'String'
                                || type == 'Object'){
                            isPr = true;
                        }
                        }%
                        #{if field.getBoolean('isList')}
                        <tr>
                            <td class="code-text">${field.getString('name')}</td>
                            <td>${field.getString('title')}</td>
                            <td class="text-nowrap">
                                List&lt;
                                #{if isPr}
                                    ${field.getString('type')}
                                #{/if}
                                #{else}
                                    <a href="/@apidoc/api_json/bean/${field.getString('type')}">${field.getString('type')}</a>
                                #{/else}
                                &gt;
                            </td>
                            <td>${field.getString('note')}</td>
                        </tr>
                        #{/if}
                        #{else}
                        <tr>
                            <td class="code-text">${field.getString('name')}</td>
                            <td>${field.getString('title')}</td>
                            <td class="text-nowrap">
                                #{if isPr}
                                    ${field.getString('type')}
                                #{/if}
                                #{else}
                                    <a href="/@apidoc/api_json/bean/${field.getString('type')}">${field.getString('type')}</a>
                                #{/else}
                            </td>
                            <td>${field.getString('note')}</td>
                        </tr>
                        #{/else}
                        #{/list}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

</div>